package com.packet.cheng.mapper;

import com.packet.cheng.entity.RedPacketRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 张在成
 * 抢红包记录
 */
@Mapper
public interface RedPacketRecordMapper {

    /**
     * 新增抢红包记录
     * @param packetRecord
     * @return
     */
    int  insertRedPacketRecord(RedPacketRecord packetRecord);

    /**
     * 查询抢红包记录
     * @return
     */
    List<RedPacketRecord>  getRedPacketRecordById(@Param("redPacketId") Integer redPacketId);

    /**
     * 查询某个用户是否领取过红包
     * @return
     */
    RedPacketRecord  getRedPacketRecordByUserId(@Param("redPacketId") Integer redPacketId, @Param("userId") Integer userId);



}
